<template>
  <div ref="rootRef">
    <slot></slot>
  </div>
</template>

<script>
import useScroll from './use-scroll'
import { ref } from 'vue'
export default {
    name: 'scroll',
    props: {
      click: {
        type: Boolean,
        default: true
      },
      probeType: {
          type: Number,
          default: 0
      }
    },
    // vue3中 推荐这样使用emits派发事件
    emits: ['scroll'],
    setup(props, { emit }) {
        const rootRef = ref(null)
        const scroll = useScroll(rootRef, props, emit)
        // dom 和 bscroll配置
        useScroll(rootRef, props, emit)
        return {
            rootRef,
            scroll
        }
    }
}
</script>

<style>
</style>
